import { Component, OnInit } from '@angular/core';
import { MdDialog } from '@angular/material';

import { ProjectCreateComponent } from '../project-create/project-create.component';
@Component({
  selector: 'app-project-list',
  templateUrl: './project-list.component.html',
  styleUrls: ['./project-list.component.scss'],
})
export class ProjectListComponent implements OnInit {
  private projects: Array<any> = [
    {
      "name": '企业合作平台0',
      "desc": '一个企业合作平台0',
      'coverImg': '/assets/covers/0.jpg'
    }, {
      "name": '企业合作平台1',
      "desc": '一个企业合作平台1',
      'coverImg': '/assets/covers/1.jpg'
    }, {
      "name": '企业合作平台2',
      "desc": '一个企业合作平台2',
      'coverImg': '/assets/covers/2.jpg'
    },
  ];
  constructor(
    private dialog: MdDialog
  ) { }

  ngOnInit() {
  }

  //创建项目
  createProject() {
    const dialogRef = this.dialog.open(ProjectCreateComponent, {
      data: 'send message'
    });
    //dialog的返回值
    dialogRef.afterClosed().subscribe(res => {
      console.log(res);
    });
  }

}
